package sample.tools;/*
 *             ┏┓     ┏┓ + +
 *           ┏━┛┻━━━━━┛┻━┓ + +
 *           ┃           ┃ + + +
 *           ┃      ━    ┃ + + + +
 *          ████━████    ┃ + + +
 *           ┃           ┃ + +
 *           ┃     ━┻    ┃ +
 *           ┃           ┃ +
 *           ┗━━┓     ┏━━┛ +
 *              ┃     ┃  + + + +
 *              ┃     ┃  + + + +  + + + +
 *              ┃     ┃  +  Code is far away from bug with the animal protecting
 *              ┃     ┃  +      神兽保佑,代码无bug
 *              ┃     ┃  +                    @author shy @date:2021-09-15 15:58
 *              ┃     ┃  + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 *              ┃     ┗━━━━━━━━━┓ +
 *              ┃               ┣━┓ +
 *              ┃               ┏━┛ + +
 *              ┗━┓ ┓ ┏━━┳ ┓ ┏━━┛ + +
 *                ┃ ┫ ┫  ┃ ┫ ┫  + +
 *                ┗━┻━┛  ┗━┻━┛  +
 */

import java.nio.charset.StandardCharsets;

/**
 * 地址栏汉字转换
 * URL地址中汉字的编码转换
 * https://blog.csdn.net/wangshuang1631/article/details/52092650?utm_source=itdadao&utm_medium=referral
 */
public class AddressBarConvert {
    public static String toUTF8(String s){
//        if(isEmpty(s))
//        {
//            return s;
//        }
        String ret;
        ret = new String(s.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
        return ret ;
    }
}
